package design_pattern.study.Iterator;

public class Client {
    public static void main(String[] args) {
        StudentAggregate aggregate = new StudentAggregateImpl();
        aggregate.addStudent(new Student("zs","1"));
        aggregate.addStudent(new Student("ls","2"));
        aggregate.addStudent(new Student("ww","3"));
        StudentIterator studentIterator = aggregate.getStudentIterator();
        while (studentIterator.hasNext()){
            Student next = studentIterator.next();
            System.out.println(next);
        }
    }
}
